
<%--
    Document   : addv030
    Created on : Jul 30, 2012, 3:14:19 PM
    Author     : ems
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/report.css"/>
        <link rel="stylesheet" type="text/css" href="../css/jquery.fancybox-1.3.4.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <!--        <link rel="stylesheet" type="text/css" href="../css/paging.css"/>-->
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery-1.7.2.min.js"></script>

    </head>   

    <script type="text/javascript">
        var open_cur = 0;
        $j = jQuery.noConflict();
        $j(document).ready(function(){

            $j('.keysearch').live('keyup',function(){
                $j('.rich-table-row').hide();
                $j('.rich-table-row').each(function(){
                    html = $j(this).html();
                    // alert( ununicode(html));  || html.indexOf( $j('.keysearch').val()) > -1
                    if(   html.indexOf( $j('.keysearch').val()) > -1    )  {
                        $j(this).show();
                    }else{
                        $j(this).hide();
                    }

                });
            });
            $j(".fq100").live("change",function(){
                fq100= $j(this).children("option:selected").val();
                pn100 = $j(this).attr("lang");
                showPleaseWait();
                $j(".alertCus").text("");
                //$j(".alert").css("display","block");
                $j.post("listCusProject.jsp?action=updatefq100&fq100="+fq100+"&pn100="+pn100,function(data){
                    if(data !=null){
                        
                        $j(".alertCus").text("Bạn cập nhật thành công!"); 
                        hidePleaseWait();                         
                        // $j(".alert").slideUp(100).fadeIn(400);
                        $j('.alertCus').delay(3000).fadeIn('slow');
                       
                    }
                }) ;
            });
            $j(".rich-table-row:odd").addClass("odd");
            
            $j('.checkht').live("change",function(){  
                var vn034 =0;
                if($j(this).is(':checked')){
                    vn034 = 1;
                }
                var pn100 = $j(this).attr('lang');
                showPleaseWait();
                //alert('v030Begin.jsp?action=updatecheckct&vn035='+vn035+'&pn100='+pn100);
                $j.post("listCusProject.jsp?action=updatevn034&vn034="+vn034+"&pn100="+pn100,function(data){
                    if(data !=null){
                        
                        $j(".alertCus").text("Bạn cập nhật thành công!"); 
                        hidePleaseWait();                         
                        // $j(".alert").slideUp(100).fadeIn(400);
                        $j('.alertCus').delay(3000).fadeIn('slow');
                       
                    }
                }) ;
                       
            });

        });

        function showPleaseWait(){
            Richfaces.showModalPanel('ajaxLoadingModalBox',{
                width:200,
                top:200
            });
            setTimeout(function(){
                hidePleaseWait();
            }, 5000);
        }
        function showPleaseWait1(){
            Richfaces.showModalPanel('ajaxLoadingModalBox',{
                width:200,
                top:200
            });
            setTimeout(function(){
                hidePleaseWait();
            }, 2000);
        }
        function hidePleaseWait(){
            Richfaces.hideModalPanel('ajaxLoadingModalBox');
        }
    </script>
    <style type="text/css">



        .rich-table{
            margin-left: 20px !important;
        }
        .rich-table-cell p
        {
            height: 0 !important;
            margin-top: -8px;
            position: relative;
        }
        .alertCus{
            color: red;
            float: left;
            font-size: 14px;
            font-weight: normal;
            margin-top: 5px;
            text-align: center;
            text-transform: uppercase;
            width: 100%;
        }
        .rich-table-subheadercell{
            background:  none repeat scroll 0 0 #4884B5;
        }
        .rich-table-subheadercell div {
            color: white !important;
            font-weight: bold;
        }
        .odd{
            background: #E0EFFC;
        }
        .cbxListC650{
            margin-top:0px;
            height:20px;
            line-height: 18px;
            width:150px;
            font-size: 11px;
        }
    </style>
    <f:view>
        <a4j:form id="form-input-customer" >
            <body style=" float:left; width:auto; height:auto; margin:0px;overflow: hidden;">
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>                
                <div class="popup" style="height:420px; width:850px;background:white;margin-top:13px; margin-right: 12px ">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="Danh sách khách hàng"/></div>
                        <div style=" position: fixed; float:left; height:50px;width:50px;left:800px;">
                            <a id="fancybox-close" onclick="self.parent.tb_remove()"  style="display: block; float:left;"></a>
                        </div>
                    </div>
                    <div class="popup-content">
                        <div class="main_content">                         
                            <div class="form_item_content" style="margin-top:5px;margin-left: -1px; height: 300px; overflow-y: auto; overflow-x: hidden;">

                                <rich:dataTable value="#{c150Controller.listCustomer}" var="cus"
                                                rows="1000" width="808px; " columnClasses=",columns,columns,columns" rowKeyVar="row"
                                                id="table" styleClass="machinePosDataTable">

                                    <rich:column style="width:20px; text-align:center">
                                        <f:facet name="header">
                                            <h:outputText value="STT" />
                                        </f:facet>
                                        <div style="width:20px; ">
                                            <h:outputText value="#{row+1}" />
                                        </div>
                                    </rich:column>
                                    <rich:column style="width:98px;height: 20px">
                                        <f:facet name="header">
                                            <h:outputText value="Họ tên" />
                                        </f:facet>
                                        <div style="width:98px; height: 20px; margin-left:5px;">
                                            <h:outputText value="#{cus.hoten}" />
                                        </div>
                                    </rich:column>
                                    <rich:column style="width:70px;">
                                        <f:facet name="header">
                                            <h:outputText value="Số điện thoại" />
                                        </f:facet>
                                        <div style="width:70px;">
                                            <h:outputText rendered="#{cus.nv107 !=null}" value="#{cus.dt} <br>" escape="false" />
                                            <h:outputText rendered="#{cus.nv108 !=null}" value="#{cus.nv108} <br>" escape="false" />
                                            <h:outputText rendered="#{cus.nv109 !=null}" value="#{cus.nv109}" escape="false" />
                                        </div>
                                    </rich:column>
                                    <rich:column style="width:auto;">
                                        <f:facet name="header">
                                            <h:outputText value="Email" />
                                        </f:facet>
                                        <div style="width:auto;">
                                            <h:outputText value="#{cus.nv105} <br>" escape="false" />                                            
                                        </div>
                                    </rich:column>
                                    <rich:column width="auto">
                                        <f:facet name="header">
                                            <h:outputText value="Địa chỉ" />
                                        </f:facet>

                                        <div style="width:auto;">
                                            <h:outputText value="#{cus.nv112}" />
                                        </div>
                                    </rich:column>
                                    <rich:column width="60px">
                                        <f:facet name="header">
                                            <h:outputText value="Hoàn thành" />
                                        </f:facet>

                                        <div style="width:60px; text-align: center">
                                            <h:selectBooleanCheckbox  value="#{cus.vn034==1}" styleClass="checkht" lang="#{cus.pn100}"></h:selectBooleanCheckbox>
                                        </div>
                                    </rich:column>
                                    <rich:column width="150px">
                                        <f:facet name="header">
                                            <h:outputText value="NV chịu trách nhiệm" />
                                        </f:facet>

                                        <div style="width:150px;">
                                            <h:selectOneMenu value="#{cus.fq100}" styleClass="fq100 cbxListC650" lang="#{cus.pn100}" id="pn100Emp" >
                                                <f:selectItems value="#{c150Controller.listC650R}" />                                                                                            
                                            </h:selectOneMenu>                                            
                                        </div>
                                    </rich:column>

                                    <%-- <f:facet name="footer">
                                         <rich:datascroller id="ds" for="table"></rich:datascroller>
                                     </f:facet> --%>
                                </rich:dataTable>

                            </div>
                            <%--    </a4j:repeat> --%>
                            <div class="alertCus"></div>
                        </div>

                    </div>

                    <div class="popup-footer">
                        <h:inputHidden  value="#{c150Controller.FC150}"/>
                        <div class="buttonsave buttonReload" onclick="self.parent.tb_remove()" lang="<h:outputText value="#{c150Controller.empId}"/>" ><span><h:outputText value="#{locale.close}" /></span></div>

                        <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                         height="30" width="40" zindex="2000">
                            <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                        </rich:modalPanel>

                    </div>

                </div>
            </body>
        </a4j:form>
    </f:view>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
    });
    function reloadProject(){
        // self.parent.tb_remove();
        emp =  $j('.buttonReload').attr('lang');
        //        alert(emp);
        window.parent.location.href="project.jsp?emp="+emp;
    }
</script>



